import React, { Component } from 'react';
import { connect } from 'react-redux'
import { Redirect } from 'react-router'

class Write extends Component {
    render() {
        if (this.props.loginState) {
            return (
                <div>
                    写文章
                </div>
            );
        } else {
            return <Redirect to='/login'></Redirect>
        }

    }
}

const mapState = (state) => ({
    loginState: state.getIn(['login', 'loginState'])
})

export default connect(mapState, null)(Write);